Page({
  data: {
    currentDate: Date.now(),
    houseLayerVisible: false,
    repairLayerVisible: false,
    dateLayerVisible: false,
    houseList: [{
        id: 1,
        name: '北京西三旗花园1号楼 101'
      },
      {
        id: 2,
        name: '北京东村家园3号楼 302'
      },
      {
        id: 3,
        name: '北京育新花园3号楼 703'
      },
      {
        id: 4,
        name: '北京天通苑北苑8号楼 403'
      }
    ],
    repairItem: [{
        id: 1,
        name: '水路卫浴'
      },
      {
        id: 2,
        name: '电路灯具'
      },
      {
        id: 3,
        name: '管道疏通'
      },
      {
        id: 4,
        name: '开锁换锁'
      }
    ],
    attachment: [{
        id: 1,
        url: '/repair_pkg/static/uploads/attachment.jpg'
      },
      {
        id: 2,
        url: '/repair_pkg/static/uploads/attachment.jpg'
      }
    ],
    mobile: '',
    description: ''
  },
  openHouseLayer() {
    this.setData({
      houseLayerVisible: true
    })
  },
  closeHouseLayer() {
    this.setData({
      houseLayerVisible: false
    })
  },
  openRepairLayer() {
    this.setData({
      repairLayerVisible: true
    })
  },
  closeRepairLayer() {
    this.setData({
      repairLayerVisible: false
    })
  },
  openDateLayer() {
    this.setData({
      dateLayerVisible: true
    })
  },
  closeDateLayer() {
    this.setData({
      dateLayerVisible: false
    })
  },
  // 提交报修
  submitForm() {
    // 跳转到报修列表页面
    wx.reLaunch({
      url: '/repair_pkg/pages/list/index'
    })
  },
  selectHouse(ev) {
    // console.log(ev.detail.name);
    this.setData({
      houseName: ev.detail.name
    })
  },
  selectRepairItem(ev) {
    this.setData({
      repairItemName: ev.detail.name
    })
  }
})